package com.gdk.ksoft.assembly.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
 * Created by hel on 2014-12-10.
 * 上传通知广播
 */
public class UploadNotifyReciever extends BroadcastReceiver {

    public static final String ACTION = UploadNotifyReciever.class.getSimpleName();

    public interface OnUploadStateChangedListener{
        public void onUploadStateChanged(boolean isUpload);
    }

    private OnUploadStateChangedListener listener;

    public UploadNotifyReciever(OnUploadStateChangedListener listener) {
        this.listener = listener;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        if(intent.getAction().equals(ACTION) && listener!=null){
            listener.onUploadStateChanged(intent.getBooleanExtra("isOpenUpload",false));
        }
    }
}
